<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('入驻详情')}" />
    <th:block th:insert="~{include :: select2-css}" />
    <style>
        .apply-text{
            line-height: 38px;
            font-size: 14px;
            color: #666666;

        }
    </style>
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
    <form id="form-user-add" class="form-horizontal"  th:object="${teacherApply}">
        <input type="hidden" th:field="*{id}" name="id">
        <h4 class="form-header h4">详细信息</h4>
        <hr>
        <div class="row">
            <div class="col-sm-5">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">名称:</label>
                    <strong class="apply-text" th:text="*{name}"></strong>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">手机号码:</label>
                    <strong class="apply-text" th:text="*{mobile}"></strong>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-5">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">职称:</label>
                    <strong class="apply-text" th:text="*{title}"></strong>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">专业:</label>
                    <strong class="apply-text" th:text="${subject == null?'无':category.categoryName}"></strong>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-5">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">毕业学校:</label>
                    <strong class="apply-text" th:text="*{finalSchool}"></strong>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">教龄:</label>
                    <strong class="apply-text" th:text="*{teachYear + ' 年'}"></strong>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-5">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">申请时间:</label>
                    <strong class="apply-text" th:text="*{createTime}"></strong>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group row">
                    <label class="col-sm-4 text-sm-right col-form-label">状态:</label>
                    <strong style="color: red" class="apply-text" th:text="*{status==0?'未审核':status==1?'已通过':'未通过'}"></strong>
                </div>
            </div>
        </div>
        <div class="row" style="padding-left: 30px">
            <div class="col-11">
                <div class="card">
                    <div class="card-header">
                        <strong >自我简介</strong>
                    </div>
                    <div class="card-body">
                        <strong style="font-size: 14px;color: #666666" th:text="*{intro}"></strong>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-left: 30px">
            <div class="col-11">
                <div class="card">
                    <div class="card-header">
                        <strong >教师资历</strong>
                    </div>
                    <div class="card-body">
                        <strong style="font-size: 14px;color: #666666" th:text="*{education}"></strong>
                    </div>
                </div>
            </div>
        </div>
        <div class="row"  th:if="${teacherApply.status == 0}" style="padding-left: 30px">
            <div class="col-sm-6">
                <div class="form-group row">
                    <label class="col-xs-2 text-sm-right col-form-label">创建管理员</label>
                    <div class="col-sm-1">
                        <input id="createManager" type="checkbox" class="form-control">
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<div class="row" th:if="${teacherApply.status == 0}">
    <label class="col-sm-2"></label>
    <div class="col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" th:onclick="examine(1)"><i class="fa fa-check"></i>通 过</button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" th:onclick="examine(2)"><i class="fa fa-reply-all"></i>驳 回 </button>
    </div>
</div>
<th:block th:insert="~{include :: footer}" />
<th:block th:insert="~{include :: select2-js}" />
<script>
    function examine(status) {
        var createManager = $("input[id='createManager']").is(':checked') == true ? 1 : 0;
        var data = $("#form-user-add").serializeArray();
        data.push({"name": "status", "value": status});
        data.push({"name": "createManager", "value": createManager});
        if (status === 1) {
            str = "确定审核通过操作吗"
        } else {
            str = "确定审核驳回操作吗"
        }
        $.modal.confirm(str, function () {
            $.operate.save("/teacher/apply/examine.json", data);
        });
    }
</script>
</body>
</html>